<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\helpers\ActionButton;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketSalesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Ticket Sales';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="container ticket-sales-index">

    <h1 class="main-title"><?= Html::encode($this->title) ?></h1>

    <p>
        <?= ActionButton::create('Добавить продажу единичного билета', 'createTicketSales') ?>
    </p>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

</div>

<div class="container-fluid contract-table-container">

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'tableOptions' => [
            'class' => 'table table-striped'
        ],
        'filterModel' => $searchModel,
        'columns' => [
        
            'id',
            'event_id',
            'date_sale',
            'is_cancell',
            'is_refund',
            'tariff',
            'selling_platform',
            'payment_method',

            [
                'class' => 'yii\grid\ActionColumn',
                'visibleButtons' =>
                [
                    'view' => Yii::$app->user->can('browseTicketSales'),
                    'update' => Yii::$app->user->can('updateTicketSales'),
                    'delete' => Yii::$app->user->can('deleteTicketSales'),
                ]
            ],
        ],
    ]); ?>


</div>
